{extend name="extra@admin/content"}

{block name="content"}

<form onsubmit="return false;" action="__SELF__" data-auto="true" method="post" class='layui-form' style='padding-top:20px'>
    <div class="layui-form-item">
        <label class="layui-form-label">推荐商品</label>
        <div class="layui-input-block">
            <select name="goods_id" lay-verify="required" lay-filter="test" lay-search>
                <option value="">请选择推荐商品</option>
                {volist name='goods' id='v'}
                <option value="{$v.id}" {if condition="$info['goods_id'] eq $v['id']"} selected {/if}>{$v.name}</option>
                {/volist}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            {if $info and isset($info.dis_order)}
            <input name="dis_order" value='{$info.dis_order|default=""}'
                   required="required" title="请输入1~1000之间的整数" pattern="^([1-9]\d{0,2}|1000)$" placeholder="请输入1~1000之间的整数" class="layui-input ">
            {else}
            <input name="dis_order" value='{$info.dis_order|default=""}'pattern="^([1-9]\d{0,2}|1000)$" required="required"
                   title="请输入1~1000之间的整数" class="layui-input">
            {/if}
        </div>
    </div>
    <div class="hr-line-dashed"></div>
    <div class="col-sm-4 col-sm-offset-2">
        {if $info and isset($info.id)}<input type='hidden' value='{$info.id}' name='id'/>{/if}
        <input type="hidden" name="cate_id" value="{$cate_id}">
        <div class="layui-form-item text-center">
            <button class="layui-btn" type="submit">保存</button>
        </div>
    </div>
    <script type="text/javascript">
    layui.use('form', function(){
        var form = layui.form;      //只有执行了这一步，部分表单元素才会自动修饰成功
        form.render();
    });

    form.on('select(test)', function(data){

    });
</script>
</form>

{/block}